<template>
  <div class="home">
    <van-swipe :autoplay="3000" width="375" height="180">
    <van-swipe-item v-for="(image, index) in images" :key="index">
      <img v-lazy="image" :style="{width: '100%', height: '100%'}" />
    </van-swipe-item>
  </van-swipe>
  </div>
</template>

<script>
import Vue from 'vue'
import { Lazyload } from 'vant'

Vue.use(Lazyload)

export default {
  name: 'Home',
  data () {
    return {
      images: []
    }
  },
  created () {
    this.$http.get('/api/tab/1?start=0', {
      headers: {
        'x-platform': 'pc'
      }
    })
   .then(data => ())
   .catch()
  }
}
</script>

<style lang="scss" scoped>

</style>
